﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using SlimDX;
using SlimDX.Direct3D9;

namespace BasicFramework.Rendering.Primitives.Indexes
{
    public struct Index : IPrimitive
    {
        #region Fields

        #endregion


        #region Properties

        public Int16 Value
        {
            get;
            set;
        }


        public int GetSize
        {
            get { return Marshal.SizeOf(typeof(Int32)); }
        }

        public VertexElement[] GetVertexElements
        {
            get { return null; }

        }
        #endregion


        #region Constructors

        public Index(Int16 value)
            : this()
        {
            Value = value;
        }

        #endregion
        

        #region Events

        #endregion



        #region Methods

        public static bool operator ==(Index left, Index right)
        {
            return left.Equals(right);
        }

        public static bool operator !=(Index left, Index right)
        {
            return !(left == right);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
        #endregion

        #region IEquatable<ColorVertex> Members

        public override bool Equals(object other)
        {
            if (other == null)
                return false;

            return GetType() == other.GetType() && this.Equals(other);
        }

        public bool Equals(Index other)
        {
            return (Value == other.Value);
        }
        #endregion

    }


}
